<%-- 
    Document   : desa
    Created on : Nov 12, 2013, 12:05:52 AM
    Author     : Shin
--%>

<%@page import="java.sql.*"%>
<%
    String desa = request.getParameter("count");
    String buffer = "<select name='desa'><option value='-1'>Select</option>";
    try {
        Class.forName("com.mysql.jdbc.Driver").newInstance();
        Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/hepo", "root", "pass");
        Statement stmt = con.createStatement();
        ResultSet rs = stmt.executeQuery("Select * from desa where id_kecamatan='" + desa + "' ");
        while (rs.next()) {
            buffer = buffer + "<option value='" + rs.getString(1) + "'>" + rs.getString(3) + "</option>";
        }
        buffer = buffer + "</select>";
        response.getWriter().println(buffer);
    } catch (Exception e) {
        System.out.println(e);
    }
%>